package com.biosimilarity.example.report;

import com.biosimilarity.example.report.Absyn.*;
import java.util.Collections;
import java.util.List;
import java.util.ArrayList;

/** BNFC-Generated Fold Visitor */
public abstract class FoldVisitor<R,A> implements AllVisitor<R,A> {
    public abstract R leaf(A arg);
    public abstract R combine(R x, R y, A arg);

/* Report */
    public R visit(com.biosimilarity.example.report.Absyn.Application p, A arg) {
      R r = leaf(arg);
      r = combine(p.report_1.accept(this, arg), r, arg);
      r = combine(p.report_2.accept(this, arg), r, arg);
      return r;
    }
    public R visit(com.biosimilarity.example.report.Absyn.Dependency p, A arg) {
      R r = leaf(arg);
      r = combine(p.formals_.accept(this, arg), r, arg);
      r = combine(p.report_.accept(this, arg), r, arg);
      return r;
    }
    public R visit(com.biosimilarity.example.report.Absyn.Aggregation p, A arg) {
      R r = leaf(arg);
      for (Report x : p.listreport_) {
        r = combine(x.accept(this,arg), r, arg);
      }
      return r;
    }
    public R visit(com.biosimilarity.example.report.Absyn.Atomic p, A arg) {
      R r = leaf(arg);
      r = combine(p.reportid_.accept(this, arg), r, arg);
      for (Question x : p.listquestion_) {
        r = combine(x.accept(this,arg), r, arg);
      }
      return r;
    }

/* Formals */
    public R visit(com.biosimilarity.example.report.Absyn.Parameters p, A arg) {
      R r = leaf(arg);
      for (ReportId x : p.listreportid_) {
        r = combine(x.accept(this,arg), r, arg);
      }
      return r;
    }

/* ReportId */
    public R visit(com.biosimilarity.example.report.Absyn.Variable p, A arg) {
      R r = leaf(arg);
      return r;
    }

/* Question */
    public R visit(com.biosimilarity.example.report.Absyn.Query p, A arg) {
      R r = leaf(arg);
      return r;
    }


}
